package com.example.liang.basamovie.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * 发现的适配器
 */
public class FindAdapter extends FragmentStatePagerAdapter {
    List<Fragment> list;
    public FindAdapter(FragmentManager fm,List<Fragment> list) {
        super(fm);
        this.list=list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position){
            case 0:return "最新";
            case 1:return "关注";
        }
        return "";
    }
}
